package csel.model;

import java.util.*;

public class GameData implements java.io.Serializable
{
	/**
	 * Change this if we change its structure.
	 */
	private static final long serialVersionUID = 1L;

	private final List<Entity> entities;
	private Entity playerEntity;
	private final Map map;
	private final ChronoTrigger chronoTrigger;

	public GameData(List<Entity> entities, Entity playerEntity, Map map)
	{
		this.entities = entities;
		this.playerEntity = playerEntity;
		this.map = map;
		this.chronoTrigger = ChronoTrigger.getInstance();
		
		for(Iterator<Entity> i = entities.iterator();i.hasNext();)
		{
			this.chronoTrigger.addTicked(i.next());
		}
	}

	public Entity get_playerEntity()
	{
		return playerEntity;
	}

	public void set_playerEntity(Entity entity)
	{
		playerEntity = entity;
	}

	public List<Entity> get_entities()
	{
		return entities;
	}

	public Map get_map()
	{
		return map;
	}

	/* TODO: write accessors */

}
